/**
 * 
 */
package com.designpattern.design.factory.absfactory.factory;

import com.designpattern.design.factory.absfactory.BJCheesePizza;
import com.designpattern.design.factory.absfactory.BJPaperPizza;
import com.designpattern.design.factory.absfactory.Pizza;
import com.designpattern.design.factory.absfactory.SHCheesePizza;
import com.designpattern.design.factory.absfactory.SHPaperPizza;

/**
 * @author zhangyang
 *
 */
public class SHFactory implements PizzaFactory {

	@Override
	public Pizza createPizza(String orderType) {
		// TODO Auto-generated method stub
		System.out.println("使用抽象方法类创建pizza");
		// pizza对象
		Pizza pizza = null;
		if ("paper".equals(orderType)) {
			pizza = new SHPaperPizza();
		} else if ("cheese".equals(orderType)) {
			pizza = new SHCheesePizza();
		} else {
			System.out.println("当前披萨种类不存在");
			return null;
		}
		return pizza;
	}

}
